﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Caifu
{
	/// <summary>
	/// 常量定义
	/// </summary>
	public static class ConstantDefinition
	{
		#region 基金状态

		static Dictionary<int, string> m_FundStates;
		/// <summary>
		/// 获取基金状态枚举值对应的文本解释。
		/// </summary>
		/// <returns></returns>
		public static Dictionary<int, string> GetFundStates()
		{
			if (m_FundStates == null)
			{
				m_FundStates = new Dictionary<int, string>();

				m_FundStates.Add(1, "预发行");
				m_FundStates.Add(2, "募集中");
				m_FundStates.Add(3, "发行结束");
				m_FundStates.Add(4, "已成立");
				m_FundStates.Add(99, "已退市");
			}

			return m_FundStates;
		}

		#endregion

		#region 基金类型

		static Dictionary<int, string> m_FundTypes;
		/// <summary>
		/// 获取基金类型枚举值对应的文本解释。
		/// </summary>
		/// <returns></returns>
		public static Dictionary<int, string> GetFundTypes()
		{
			if (m_FundTypes == null)
			{
				m_FundTypes = new Dictionary<int, string>();

				m_FundTypes.Add(1, "封闭式基金");
				m_FundTypes.Add(2, "开放式基金");
				m_FundTypes.Add(3, "货币型基金");
				m_FundTypes.Add(4, "创新型基金");
				m_FundTypes.Add(99, "其他");
			}

			return m_FundTypes;
		}

		#endregion

		#region 投资类型

		static Dictionary<int, string> m_InvestmentTypes;
		/// <summary>
		/// 获取投资类型枚举值对应的中文解释。
		/// </summary>
		/// <returns></returns>
		public static Dictionary<int, string> GetInvestmentTypes()
		{
			if (m_InvestmentTypes == null)
			{
				m_InvestmentTypes = new Dictionary<int, string>();

				m_InvestmentTypes.Add(0, "请选择");
				m_InvestmentTypes.Add(1, "股票型");
				m_InvestmentTypes.Add(2, "债券型");
				m_InvestmentTypes.Add(3, "混合型");
				m_InvestmentTypes.Add(4, "货币型");
				m_InvestmentTypes.Add(99, "其他型");
			}

			return m_InvestmentTypes;
		}

		static Dictionary<int, string> m_InvestmentTypesEN;
		/// <summary>
		/// 获取投资类型枚举值对应的英文解释。
		/// </summary>
		/// <returns></returns>
		public static Dictionary<int, string> GetInvestmentTypesEN()
		{
			if (m_InvestmentTypesEN == null)
			{
				m_InvestmentTypesEN = new Dictionary<int, string>();

				m_InvestmentTypesEN.Add(0, "select");
				m_InvestmentTypesEN.Add(1, "stock");
				m_InvestmentTypesEN.Add(2, "bond");
				m_InvestmentTypesEN.Add(3, "mixed");
				m_InvestmentTypesEN.Add(4, "currency");
				m_InvestmentTypesEN.Add(99, "other");
			}

			return m_InvestmentTypesEN;
		}
		/// <summary>
		/// 获取投资类型枚举值对应的中文解释。
		/// </summary>
		/// <param name="investmentType"></param>
		/// <returns></returns>
		public static string GetInvestmentTypeNameCN(int investmentType)
		{
			var dict = GetInvestmentTypes();
			if (dict.ContainsKey(investmentType))
			{
				return dict[investmentType];
			}
			return "";
		}

		/// <summary>
		/// 获取投资类型枚举值对应的英文解释。
		/// </summary>
		/// <param name="investmentType"></param>
		/// <returns></returns>
		public static string GetInvestmentTypeNameEN(int investmentType)
		{
			var dict = GetInvestmentTypesEN();
			if (dict.ContainsKey(investmentType))
			{
				return dict[investmentType];
			}
			return "";
		}

		#endregion

		#region 投资风格

		static Dictionary<int, string> m_InvestmentStyles;
		/// <summary>
		/// 获取投资风格枚举值对应的文本解释。
		/// </summary>
		/// <returns></returns>
		public static Dictionary<int, string> GetInvestmentStyles()
		{
			if (m_InvestmentStyles == null)
			{
				m_InvestmentStyles = new Dictionary<int, string>();

				m_InvestmentStyles.Add(0, "无");
				m_InvestmentStyles.Add(1, "1");
				m_InvestmentStyles.Add(2, "2");
				m_InvestmentStyles.Add(3, "3");
				m_InvestmentStyles.Add(4, "4");
				m_InvestmentStyles.Add(5, "5");
				m_InvestmentStyles.Add(99, "99");
			}

			return m_InvestmentStyles;
		}

		#endregion
	}
}
